package util.biz.openjaw;

import util.util.DevFileUtil;

import java.util.function.Function;

/**
 * @Author liw
 * @Date 2021/4/20 16:38
 * @Version 1.0
 */
public class CopyFile {

    private static final String ROOT_PATH = "";
    private static final String OLD_NAME = "";
    private static final String newPath = "";
    private static final String createPath = "";



    public static void main(String[] args) {
//        String fileName = "\\__files";
        String fileName = "\\mappings";
        change(fileName);
    }

    private static void change(String fileName) {
        Function<String, String> changeName = (name) -> {
            int i = name.lastIndexOf(".");
            return name.substring(0, i) + "_new" + name.substring(i);
        };
        String rootPath = System.getProperty("user.dir");

        DevFileUtil.copyAllFileList(rootPath + fileName+"_old", rootPath + fileName, null);
        DevFileUtil.copyAllFileList(rootPath + fileName+"_new", rootPath + fileName, changeName);
    }


}
